1. Field of the Invention
The present invention generally relates to processing images, and more particularly to a system and method for converting a color image of a first bit size into a color image of a second bit size.
2. Background of the Related Art
In the related art, a pallet has been developed to indicate color information for an 8-bit image. Accordingly, when a color value of a pixel of an 8-bit color image is calculated, a red/green/blue (RGB) value can easily be read from the pallet only by using an index value. However, unlike an 8-bit image, no pallet concept has been developed for expressing color information in a 16-bit image. This is because 16-bit images are expressed using 2 bytes and because a pixel itself has color information. Thus, RGB values corresponding to pixels in a 16-bit image have to be obtained through calculation. The method used to calculate RGB values for a 16-bit image can differ depending upon the type of image conversion method.
When a 24-bit image is converted to a 16-bit image supported by a mobile communication terminal, in order to allocate RGB values for each of the pixels of the 24-bit image to the 16-bit image evenly, the color value for each pixel in the 24-bit image is divided by 3, and five bits are then allocated for each of the RGB colors in the 16-bit image and one bit remains unused. More specifically, two 16-bit color display methods have been proposed in the related art which involve converting a 24-bit image into a 16-bit. These methods are the 5:5:5 method and the 5:6:5 method.
FIG. 1 shows how an image converting process is performed using the 5:5:5 method. In converting an 8-bit RGB value into a 16-bit RGB value, 5 bits are allocated to each of the R, G, B colors and the remaining 1 bit is not used. More specifically, 8-bit RGB values in respective shifters 111–113 are stored in a memory 114 as 5-bit values, and the remaining 1 bit (represented as the leading “0” bit) is not used.
In the 5:5:5 method, color values are calculated as follows. When there are RGB colors, RGB values are represented by 5 bits each, which means that a loss of 3 bits occurs for each color in the 24-bit image. This may be described as R16=R/8, G16=G/8 and B/16=B/8. After calculating 16-bit color, the R value stored in shifter 111 is shifted towards the right 3 bit positions and the remaining R bits are output to register 114, which is shifted toward the left to the 10th bit position. The G value stored in register 112 is shifted towards the right 3 bit positions and the remaining G bits are output to register 114, which is shifted toward the left to the 5th bit position. And, the B value stored in register 113 is shifted towards the right 3 bit positions and the remaining B bits are output to register 114. Accordingly, a 16-bit RGB value is obtained in register 114 with a 0 value inserted into the 16th bit position.
FIG. 2 shows how an image converting process is performed using the 5:6:5 method in accordance with the related art. First, 8-bit RGB values are converted into a 16-bit RGB value, by respectively allocating 5 bits to each of the R, G and B values. The remaining 1 bit is unconditionally allocated to the G value at all times. This extra bit allocation is performed because the eyes of a human being classify green color well. Therefore, providing the extra bit to the green color ostensibly helps in this regard.
Unlike the 5:5:5 method, in the 5:6:5 method, the R and B values respectively lose 3 bits but the G value loses 2 bits. The R and B values therefore have a start bit different from each other. More specifically, when there are RGB colors, R and B respectively have 5 bits and G has 6 bits. This may be described as R16=R/8, G16=G/4 and B16=B/8.
After calculating a 16-bit color as a combined 16-bit RGB value for each pixel, the R value in register 211 is shifted towards the right 3 bits and the remaining R bits are output to register 214, which is shifted towards the left to the 11th bit position. The G value in register 212 is shifted towards the right by 2 bits and the remaining G bits are output to register 214, which is shifted towards the left to the 5th bit position. And, the B value in register 213 is shifted towards the right by 3 bits and the remaining B bits are output to register 214. Accordingly, a 16-bit RGB value is obtained in register 214.
In the 5:5:5 method of the related art, by wasting 1 bit, more color information of an actual image is lost. And in the 5:6:5 method, 1 more bit is unconditionally allocated to the G value than to the R and B values, thereby emphasizing the G color more than an actual color. As a result, the image may be converted into an image which is generally similar to a C color. A need therefore exists for a system and method which more accurately and efficiently represents color information in a converted color image, including but not limited to 16-bit color images which have been formed as a result of a conversion process from a 24-bit color image.